package nobu.nakata.nfcfare.resource.util;

import java.util.Collections;

import javax.jdo.PersistenceManager;

import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserServiceFactory;

import net.sf.jsr107cache.Cache;
import net.sf.jsr107cache.CacheException;
import net.sf.jsr107cache.CacheManager;
import nobu.nakata.nfcfare.PMF;

public class ServiceResourceUtil {
	static public Cache makeCache() throws CacheException {
		return CacheManager.getInstance().getCacheFactory().createCache(Collections.emptyMap());		
	}
	static public User getViewer() {
		//return new User("nobu.nakata@gmail.com", "");
		return UserServiceFactory.getUserService().getCurrentUser();
	}
	static public PersistenceManager makeStorage() {
		return PMF.getInstance().getPersistenceManager();
	}
}
